package com.m4u.entity;

import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.OneToOne;
import javax.persistence.TableGenerator;

import org.hibernate.annotations.ForeignKey;

//@Entity(name = "cliente_image")
@TableGenerator(name = "CLIENTE_IMAGE_ID", pkColumnValue = "CLIENTE_IMAGE_ID", allocationSize = 1)
public class ClienteImage {

    @Id
    @GeneratedValue(strategy = GenerationType.TABLE, generator = "CLIENTE_IMAGE_ID")
    private int id = 0;

    @OneToOne(fetch = FetchType.LAZY)
    @ForeignKey(name = "fk_image_cliente")
    private Cliente cliente = null;

    @Lob
    private byte[] image;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public Cliente getCliente() {
        return cliente;
    }

    public void setCliente(Cliente cliente) {
        this.cliente = cliente;
    }

    public byte[] getImage() {
        return image;
    }

    public void setImage(byte[] image) {
        this.image = image;
    }

}
